﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;

namespace Logic
{
    public class DivisionCalculator
    {
        public static int CalculateDuration(Division division)
        {
            int totalDuration = 0;

            List<AbstractMusic> music = division.Music;
            
            foreach (AbstractMusic track in music)
            {
                if (track.Duration != null)
                    totalDuration = totalDuration + track.Duration;
            }

            return totalDuration;
        }
    }
}
